package xp.ass.imitate.config;

import org.apache.commons.lang3.StringUtils;

/**
 * @author chent3
 * @date 2024/7/22
 */
public interface Config {

    default String getProperty(String key) {
        return getProperty(key, String.class, null);
    }

    default String getProperty(String key, String defVal) {
        return getProperty(key, String.class, defVal);
    }

    default Integer getIntProperty(String key) {
        return getProperty(key, Integer.class, null);
    }

    default Integer getIntProperty(String key, Integer defVal) {
        return getProperty(key, Integer.class, defVal);
    }

    default Byte getByteProperty(String key) {
        return getProperty(key, Byte.class, null);
    }

    default Byte getByteProperty(String key, Byte defVal) {
        return getProperty(key, Byte.class, defVal);
    }

    default Long getLongProperty(String key) {
        return getProperty(key, Long.class, null);
    }

    default Long getLongProperty(String key, Long defVal) {
        return getProperty(key, Long.class, defVal);
    }

    <T> T getProperty(String key, Class<T> clazz, T defaultVal);


    void addChangeListener();

}
